package main

import (
	"fmt"
	"os"
)

func main() {
	ff, err := os.OpenFile("../file/20211028.vim", os.O_RDWR, 6)
	defer ff.Close()
	if err != nil {
		fmt.Println("openFile faild,err:", err)
		return
	}
	//往文件写数据
	_, err = ff.WriteString("tody  tired") //因为文件只读，所以报错
	if err != nil {
		fmt.Println("writeSting file faild,err:", err)
		return
	}
	fmt.Println("writeSting file success")
}
